package com.whoiszxl.db.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.whoiszxl.db.model.MemberPO;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 会员表 Mapper 接口
 * </p>
 *
 * @author whoiszxl
 * @since 2022-04-01
 */
public interface MemberMapper extends BaseMapper<MemberPO> {

    /**
     * 切换用户状态
     * @param memberId 用户ID
     * @return 是否切换成功
     */
    @Update("update sys_admin set status = (case status when 1 then 0 else 1 end) where id = #{adminId}")
    Boolean switchStatus(Integer memberId);
}
